﻿using System;
using System.Collections.ObjectModel;
using System.Collections.Generic;

using Finance.Entites;
using Finance.Service.Interfaces;

namespace Finance.Service.Implements
{
    /// <summary>
    /// Store the data with json format in the disk
    /// </summary>
    /// <typeparam name="TEntity">The graph of store object contains in ObserableCollection</typeparam>
    public class MockProjectDataStore : JsonDataStore<Finance.Entites.Project>
    {
        private static ObservableCollection<Project> _ProjectCollections = new ObservableCollection<Project>();

        public override ObservableCollection<Project> Items
        {
            get
            {
                if (base._Items == null || base._Items.Count == 0)
                {
                    _ProjectCollections.Clear();

                    _ProjectCollections.Add(new Project() { Name = "暂无项目", });
                    _ProjectCollections.Add(new Project() { Name = "出差报销", });
                    _ProjectCollections.Add(new Project() { Name = "消费报销", });
                    _ProjectCollections.Add(new Project() { Name = "红包奖金", });
                    _ProjectCollections.Add(new Project() { Name = "第二收入", });
                    _ProjectCollections.Add(new Project() { Name = "家政装修", });
                    _ProjectCollections.Add(new Project() { Name = "灰色收入", });
                    _ProjectCollections.Add(new Project() { Name = "其他项目", });

                    base._Items = _ProjectCollections;
                    base.Commit();
                }
                return base._Items;
            }
        }
    }
}
